var manager, g;
        $(f_initGrid);
        function f_initGrid()
        {
        	var model="Order";
        	var message="订单";
            g = manager = $("#maingrid").ligerGrid({
                columns: [
                { display: '主键', name: 'id', width: 50, type: 'int', frozen: true },
                { display: '支付流水号', name: 'tradeno',width:160 },
                { display: '电话', name: 'phone',width: 60 },
                { display: '手机', name: 'telephone',width: 100 },
                { display: '收货人', name: 'accepter',width: 60 },
                { display: '总金额', name: 'total',width: 60 },
                { display: '状态', name: 'state',width: 60 },
                { display: '快递', name: 'logisticsName',width: 60 },
                { display: '收货地址', name: 'address',width: 160 },
                { display: '留言', name: 'message',width: 160 },
				{ display: '创建时间', name: 'showDate',width: 120 },
                { display: '操作', isSort: false, width: 120, render: function (rowdata, rowindex, value)
                {
                	var h = "<a href='javascript:beginEdit(" + rowindex + ",\"" + model + "\",\"" + message + "\")'>修改</a> ";
 	                h+= "<a href='javascript:deleteRow(" + rowindex + ",\"" + model + "\")'>删除</a> ";
 	                h+= "<a href='javascript:f_addTab(" + rowindex + ")'>订单详情</a> ";
 	                
                    return h; 
                }
                }
                ],
                onSelectRow: function (rowdata, rowindex)
                {
                    $("#txtrowindex").val(rowindex);
                },
                enabledEdit: false,clickToEdit:false, isScroll: false,
                url:"manageLoadOrderList?type="+p_type,	
                pageSize:10,
                width: '100%'
               
            });   
        }
        function f_addTab(rowid)
        { 
        	var id= manager.getRow(rowid).id;
        	$.ligerDialog.open({ height: 400, url: 'manageCartList?order.id='+id, width: 900, showMax: true, showToggle: true, showMin: true, isResize: true, modal: false,
        		title: "订单：【"+manager.getRow(rowid).accepter+"】【"+manager.getRow(rowid).logisticsName+"-"+manager.getRow(rowid).address+"-"+manager.getRow(rowid).postcode+"】【"+manager.getRow(rowid).phone+"-"+manager.getRow(rowid).telephone+"】"});
         } 
